import server from "../../utils/axios.js";
import { isArray, isArrayEmpty } from "@/utils/validate";
/**
 * @description 功能
 */
export default class System4 {
  constructor() {}
  /**
   * @description 得到字典List
   */
  static async get(rowid) {
    let result = await server(this.name, "Get", { rowid });
    return result;
  }
  /**
   * @description 得到功能List
   */
  static async Save(data, ...ags) {
    if (ags.length != 0) {
      const code = data,
        name = ags[0],
        value1 = ags[1],
        value2 = ags[2] || "";
      let result = await server(this.name, "SaveByCode", {
        code,
        name,
        value1,
        value2
      });
      return result;
    }
    let result = await server(this.name, "Save", data);
    return result;
  }
  /**
   * @description 得到字典下拉
   */
  static async GetDDLitemBySys5code(code = "") {
    let result = await server(this.name, "GetDDLitemBySys5code", { code });
    return result;
  }
  /**
   * @description 得到字典 通过字典编号
   */
  static async GetSys4ByCode(code = "") {
    let result = await server(this.name, "GetSys4ByCode", { code });
    return result;
  }
  /**
   * @description 得到字典 通过字典编号
   */
  static async GetSys4ByTypeCode(typecode = "") {
    let result = await server(this.name, "GetSys4ByTypeCode", { typecode });
    return result;
  }
}
